<template>
  <div class="dashboard-container">
    <!-- <div class="dashboard-text">name:{{name}}</div> -->
    <!-- <div class="dashboard-text">roles:<span>{{roles}}</span></div> -->
    <div class="d_content">
      <!-- <button>测试</button> -->
      <router-link to="/test">测试</router-link>
      <h2 style="font-size: 50px;color: #cec7c7;">欢迎进入</h2>
      <h2>V来时代 - 后台管理系统</h2>
      <b>———— 2020© V来时代</b>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import audio from '@/assets/audio/a_0.mp3'
export default {
  name: 'home',
  computed: {
    ...mapGetters([
      'name',
      'roles'
    ])
  },
  created() {
    console.log('欢迎进入后台管理......')
  },
  mounted() {
    // this.playAudio()
  },
  methods: {
    // 播放语音
    playAudio() {
      const iframe = document.createElement('iframe')
      iframe.src = audio
      iframe.style.display = 'none'
      iframe.align = 'autoplay' // 自动播放
      document.body.appendChild(iframe)
      iframe.onload = () => {
        setTimeout(() => {
          document.body.removeChild(iframe)
        }, 10 * 1000)
      }
    }
  }
}
</script>·

<style rel="stylesheet/scss" lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
.d_content{
    margin: 25vh 0;
    text-align: center;
    b{margin-left: 15%;color: #1942bb;}
}
</style>
